export default [
    {path:"/",redirect:"/home"},
    //component 不是components
    {path:"/home",component:()=>import(/*webpackChunkName : "home" */"pages/home/home")},
    {path:"/login",component:()=>import(/*webpackChunkName : "login" */"pages/login/login")},
    {path:"/order",component:()=>import(/*webpackChunkName : "order" */"pages/order/order")},
    {path:"/cart",component:()=>import(/*webpackChunkName : "cart" */"pages/cart/cart")},
    {path:"/register",component:()=>import(/*webpackChunkName : "register" */"pages/register/register")},
    {
        name:"search",
        path:"/search/:keyword?",
        component:()=>import(/*webpackChunkName : "search" */"pages/search/search"),
        props:route=>({
            keyword:route.params.keyword,
            categoryName:route.query.categoryName,
            category1Id:route.query.category1Id,
            category2Id:route.query.category2Id,
            category3Id:route.query.category3Id
        })
    },
    {path:"*",component:()=>import(/*webpackChunkName : "404" */"pages/404")},
]